<?php
ob_start();
session_start();

include("conf/config.php");
include("conf/database.php");
include("conf/tools.php");
$memberId=$_SESSION["member_id"];

$curTime=getIndianDateTime();

$memberExp=getMemberExp($memberId);

if(isset($_POST)) {
$exp=$_POST['experince'];
}

$target_path = "images/experience/";


$actual_path=$target_path . $memberId . "/";
if(!is_dir($target_path)) mkdir($target_path);
if(!is_dir($actual_path)) mkdir($actual_path);


$actual_path1=$target_path1 . $memberId . "/";
if(!is_dir($target_path1)) mkdir($target_path1);
if(!is_dir($actual_path1)) mkdir($actual_path1);


$target_path = $target_path . basename( $_FILES['file_photo']['name']); 

$arrInfo=array();
if(move_uploaded_file($_FILES['file_photo']['tmp_name'],$actual_path.$_FILES['file_photo']['name'])) {
	$file_name=$_FILES['file_photo']['name'];
		
} 

if(empty($memberExp)) {
$query = "INSERT INTO `bkitc_member_exp` (`member_id`,`experiences`,`filename`,`uploaded`,'is_approved') VALUES('$memberId','$exp','$file_name','$curTime','0')";
}else {
$query = "UPDATE `bkitc_member_exp` SET `experiences`='".$exp."',`filename`='".$file_name."',`uploaded`='".$curTime."',`is_approved`=0 WHERE `member_id`=$memberId";

}
qry_data($query); 

header("location:shareyourexperience.php?mode=1");

?>